// -----------------------------------------------------------------------
// Copyright (c) Microsoft Corporation.  All rights reserved.
// -----------------------------------------------------------------------
using System;
using System.Reflection;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace System.ComponentModel.Composition.Factories
{
    public static partial class CatalogFactory
    {
        public static ComposablePartCatalog Create()
        {
            return new NoOverridesComposablePartCatalog();
        }

        public static ComposablePartCatalog CreateDefaultAttributed()
        {
            return CreateAttributed(typeof(CatalogFactory));
        }

        public static ComposablePartCatalog CreateDisposable(Action<bool> disposeCallback)
        {
            return new DisposableComposablePartCatalog(disposeCallback);
        }

        public static ComposablePartCatalog CreateAttributed(Type type)
        {
            return CreateAttributed(type.Assembly);
        }

        public static ComposablePartCatalog CreateAttributed(Assembly assembly)
        {
            return new AttributedAssemblyPartCatalog(assembly);
        }

        public static ComposablePartCatalog CreateAttributedForTypes(params Type[] types)
        {
            return new AttributedTypesPartCatalog(types);
        }
    }
}
